using Anvil.Core;

namespace Anvil.Core.Commands
{
	/// <summary>
	/// Invoke a query that returns the count of a result set.
	/// </summary>
	/// <remarks>
	/// The implementation uses a string format 
	/// since databases may return the count in various numeric types. 
	/// </remarks>
	public class BaseCount : BaseList
	{
        /* : BaseList
		public override bool RequestExecute(IRequestContext context)
		{
			PreProcess(context);
			object result = Mapper.QueryForObject(QueryID, context);
			context[Tokens.ITEM_COUNT] = result;
			return CONTINUE;
		}
         */

        public override bool RequestExecute(IRequestContext context)
        {
            object result = Mapper.QueryForObject(QueryID, context);
            context[Tokens.ITEM_COUNT] = result;
            return CONTINUE;
        }

	}
}